//
// 封装获取文章新闻推荐
// 导入axios副本
import request from '@/utils/request'
export function getArticles (params) {
  return request({
    url: '/v1_0/articles',
    methhod: 'get',
    params
  })
}
// 封装获取文章详情
export function getDetails (id) {
  return request({
    url: `/v1_0/articles/${id}`, // 参数的拼接
    methhod: 'get'
  })
}
// 封装对文章点赞接口
export function getArticleLikings (data) {
  return request({
    url: '/v1_0/article/likings',
    method: 'post',
    data
  })
}
// 封装对文章取消点赞接口
export function getArticleDislikings (id) {
  return request({
    url: `/v1_0/article/likings/${id}`,
    method: 'DELETE'
  })
}
// 封装对文章喜欢接口
export function getArticleLove (data) {
  return request({
    url: '/v1_0/article/dislikes',
    method: 'POST',
    data
  })
}
// 封装对文章不喜欢接口
export function getArticleDisLove (id) {
  return request({
    url: `/v1_0/article/dislikes/${id}`,
    method: 'DELETE'
  })
}

// 关注用户
export function following (data) {
  return request({
    url: '/v1_0/user/followings',
    method: 'POST',
    data
  })
}
